package plantilla;

import modelUtil.Configuracion;

public final class PlantillaDAOFactory {

	private PlantillaDAOFactory() {
	}

	public static IPlantillaDAO GetDAO() {

		try {

			Configuracion.instancia().leerDoc();
			String daoClassName = Configuracion.instancia().getPlantillaDAOclass();

			if (daoClassName.equals("XMLPlantillaDAO")) {
				/*
				 * Assembly assembly = Assembly.GetExecutingAssembly();
				 * 
				 * Object theObject = AppDomain.CurrentDomain.
				 * CreateInstanceAndUnwrap(assembly.FullName, daoClassName);
				 */
				XMLPlantillaDAO theObject = new XMLPlantillaDAO();
				return (IPlantillaDAO) theObject;
			}
			return null;

		} catch (Exception e) {
			return null;
		}

	}
}
